---
title: Report print
summary: Ensures a report is rendered, then prints the resulting bytes to a caller-supplied printer.
status: draft
owner: SAIF Documentation
last_reviewed: 2026-09-01
library: SAIF.Services.Printing
reference_type: embedded
operation_id: op-07-report-print
trigger: Caller invokes ReportBase.Print
---

# Report print

Ensures a report has been rendered — reusing a cached render or forcing a fresh one — and then sends the resulting bytes to a caller-supplied printer.

| Field | Value |
| --- | --- |
| **Operation ID** | OP-07 |
| **Trigger** | `Print` invoked |
| **Inputs** | `printer As String`, `overwrite As Boolean = False`, cached or freshly rendered `ReportFile` |
| **Outputs** | `True`/`False` |
| **Primary components** | `ReportBase.Print`, `Render`, `clsPrint.printPDF` |
| **Entry point** | `Public Function Print(printer As String, Optional overwrite As Boolean = False) As Boolean` |

## Steps

1. If `m_reportFile Is Nothing` or `overwrite` is requested, calls `Render(overwrite)` first to ensure a rendered file exists (or is refreshed).

   > **Origin**: This step is the full [Report render lifecycle](op-06-report-render-lifecycle.md) operation, including its render-result caching ([BR-PRT-007](../business-rules.md#br-prt-007-render-result-caching)) and non-throwing failure handling ([BR-PRT-010](../business-rules.md#br-prt-010-non-throwing-render-and-distribute-failures)), invoked inline.
2. Checks whether `m_reportFile` is not `Nothing` — i.e., whether rendering (new or cached) actually produced bytes.
   - If `False`: printing is skipped and `result` remains `False`.
   - Note: `Render`'s own return value is **not** checked here — only the resulting `m_reportFile` state is. A `Render` call that returned `False` due to a caught exception but left a stale `m_reportFile` populated (e.g., from a prior successful render before a later overwrite failure) would still be treated as printable.*
3. If `m_reportFile` is not `Nothing`: sets `xPrint.Printer = printer` (the caller-supplied printer, distinct from `Render`'s own default-printer resolution — [BR-PRT-009](../business-rules.md#br-prt-009-default-printer-and-security-platform-selection)) and calls `xPrint.printPDF(m_reportFile)`.

   > **Origin**: The `printPDF` call is the same operation documented as [Print rendered bytes](op-03-print-rendered-bytes.md), which always reports unconditional success ([BR-PRT-013](../business-rules.md#br-prt-013-print-and-distribute-report-unconditional-success)).
4. Returns `True` if step 3 ran, `False` otherwise.

## Process flow

```mermaid
flowchart TD
	Start([Print called]) --> Need{"reportFile Nothing<br>OR overwrite?"}
	Need -->|Yes| Render["Render()<br>(→OP-06)"]
	Need -->|No| Skip["skip render"]
	Render --> Have{"reportFile<br>now set?"}
	Skip --> Have
	Have -->|No| Fail(["Return False"])
	Have -->|Yes| SetPrinter["Set Printer"]
	SetPrinter --> PrintPDF["printPDF<br>(→OP-03, BR-PRT-013)"]
	PrintPDF --> Ok(["Return True"])
```

## Failure and edge-case behavior

- Unlike `Render` and `Distribute`, `Print` has **no** try/catch of its own: any exception from `printPDF` (itself normally suppressed to `True` per [BR-PRT-013](../business-rules.md#br-prt-013-print-and-distribute-report-unconditional-success), but whose underlying SOAP call can still throw) propagates directly out of `Print` — a contrast with OP-06's and OP-08's non-throwing contract.
- No `ErrorDetail` is ever added by `Print` itself, even on the `result = False` path from step 2.

## Related documentation
- [Index](../index.md)
- [Overview](../overview.md)
- [Architecture](../architecture.md)
- [Dependencies](../dependencies.md)
- [Operations and processes](../operations-processes.md)
- [Business rules](../business-rules.md)
- [Configuration](../configuration.md)
- [API reference](../api/index.md)

> **Note:** Statements marked with * were inferred from code structure, naming conventions, or
> contextual evidence where direct confirmation was not available in source artifacts. Statements
> marked with ** could not be confirmed; treat as unknown until verified.

## Sources
- `SAIF.Services.Printing/Reporting/ReportBase.vb`
- `SAIF.Services.Printing/Reporting/IReport.vb`
